import request from '../utils/request'

export default {
  chat(prompt) {
    return request.post("/ai/chat", { prompt }, {
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
  
  streamChat(prompt) {
    return request.post("/ai/chat", { prompt }, {
      headers: {
        'Content-Type': 'application/json',
        'Accept': 'text/event-stream'
      },
      responseType: 'stream'
    })
  }
}